import {Result} from "@/model";
import request from "@/utils/request";
import {AxiosPromise} from "axios";

/**
 * 获取博客信息
 * @returns 博客信息
 */
export function getBlogInfo() {
    return request({
        url: "/system/config/getPortalConfig",
        method: "get",
    });
}

/**
 * 上传访客信息
 */
export function report(): AxiosPromise<Result<null>> {
    return request({
        url: "/report",
        method: "post",
    });
}

/**
 * 背景轮播图
 */
export function getSwiperList(): AxiosPromise<Result<string[]>> {
    return request({
        url: "/note/note/getSwiperList",
        method: "get",
    });
}

interface Note {
    title: string,
    compilations: any[]
}

/**
 * 背景轮播图
 */
export function getSentence(): AxiosPromise<Result<Note>> {
    return request({
        url: "note/note/getRandomOneByClassify",
        data: 100,
        method: "post",
    });
}
export function getSongs(): AxiosPromise<Result<Note>> {
    return request({
        url: "note/note/getRandomOneByClassify",
        data: 105,
        method: "post",
    });
}